package com.lu.adog.demo.main.page.view.adapter;

import android.content.Context;
import android.view.View;

import com.lu.adog.R;
import com.lu.adog.demo.common.CommonTask;
import com.lu.adog.demo.common.adapter.CommonAdapter;
import com.lu.adog.demo.main.data.model.ItemModel;
import com.lu.adog.demo.main.page.view.dogitem.stackcardview.StackCardViewActivity;
import com.lu.adog.demo.main.page.view.sortpreview.SortPreViewActivity;

import java.util.List;
import java.util.SortedMap;

/**
 * @author Yue
 * @date 2017/11/29 17:26
 */

public class TourViewAdapter extends CommonAdapter{
    public TourViewAdapter(Context context) {
        super(context);
    }

    @Override
    protected void initItemModeArray(Context context, List<ItemModel> itemModelList) {
        int[] names = {R.string.stack_card_view_name,R.string.sort_preview_name};
        int[] des = {R.string.stack_card_view_des,R.string.sort_preview_des};

        new CommonTask().genItemModelList(itemModelList, names, des);
    }

    @Override
    protected void onItemModelClick(View view, int position, int itemNameStrId) {
        switch (itemNameStrId) {
            case R.string.stack_card_view_name:
                visitActivity(StackCardViewActivity.class,R.string.stack_card_view_name);
                break;
            case R.string.sort_preview_name:
                visitActivity(SortPreViewActivity.class,R.string.sort_preview_name);
                break;

            default:
                break;
        }
    }
}
